//
//  AppDelegate.swift
//  Z048
//
//  Created by remy on 2017/11/17.
//  Copyright © 2017年 remy. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        AppConfig.set()
        window = UIWindow(frame: UIScreen.main.bounds)
        window?.rootViewController = RootVC()
        window?.makeKeyAndVisible()
        return true
    }

    func applicationWillResignActive(_ application: UIApplication) {}

    func applicationDidEnterBackground(_ application: UIApplication) {
        // MARK: 先进入后台再强制kill,不会调用applicationWillTerminate
        NotificationCenter.default.post(name: .GAME_QUIT, object: nil)
    }

    func applicationWillEnterForeground(_ application: UIApplication) {}

    func applicationDidBecomeActive(_ application: UIApplication) {}

    func applicationWillTerminate(_ application: UIApplication) {
        NotificationCenter.default.post(name: .GAME_QUIT, object: nil)
    }
}
